//// include DevIL for image loading
//#include <IL/il.h>
//// assimp include files. These three are usually needed.
//#include <assimp.hpp>	
//#include <aiPostProcess.h>
//#include <aiScene.h>
//// include GLEW to access OpenGL 3.3 functions
//#include <GL/glew.h>
//// GLUT is the toolkit to interface with the OS
//#include <GL/freeglut.h>
//#include "HelloOpenGLCommon.h"
//GLuint vertexShader;
//GLuint fragmentShader;
//GLuint programObject;
//GLuint positionLoc;
//GLuint texCoordLoc;
//GLint colorLoc;
//GLuint baseMapLoc;
//GLuint baseMapTexId;
//V3F_C4B_T2F_Quad* quad = NULL;
//int init()					 
//{
//	GLint linked;
//	char vShaderStr[] =  
//		"attribute vec4 a_position;   \n"
//		"attribute vec2 a_texCoord;   \n"
//		"attribute vec4 a_color;   \n"
//		"varying vec2 v_texCoord;     \n"
//		"varying vec4 u_color;     \n"
//		"void main()                  \n"
//		"{                            \n"
//		"   gl_Position = a_position; \n"
//		"   v_texCoord = a_texCoord;  \n"
//		"   u_color = a_color;  \n"
//		"}                            \n";
//
//	char fShaderStr[] =  
//		"precision mediump float;                            \n"
//		"varying vec2 v_texCoord;                            \n"
//		"varying vec4 u_color;		                         \n"
//		"uniform sampler2D s_baseMap;                        \n"
//		"void main()                                         \n"
//		"{                                                   \n"
//		"  vec4 baseColor;                                   \n"
//		"                                                    \n"
//		"  baseColor = texture2D( s_baseMap, v_texCoord );   \n"
//		"  gl_FragColor = baseColor * u_color;   \n"
//		"}                                                   \n";
//	const char *vv = vShaderStr;
//	const char *ff = fShaderStr;
//	// Create the program object
//	programObject = HelloOpenGLCommon::loadProgram(vv,ff);
//
//	if ( programObject == 0 )
//		return 0;
//
//	positionLoc = glGetAttribLocation ( programObject, "a_position" );
//	texCoordLoc = glGetAttribLocation ( programObject, "a_texCoord" );
//
//	colorLoc = glGetAttribLocation ( programObject, "a_color" );
//
//	baseMapLoc = glGetUniformLocation ( programObject, "s_baseMap" );
//	// Load the textures
//	baseMapTexId = HelloOpenGLCommon::loadTexture( "a.png" );
//
//	if ( baseMapTexId == 0)
//	{
//		printf("can't load texture!\r\n");
//		return FALSE;
//	}
//	HelloOpenGLCommon::genRectQuad(&quad);
//	quad->tex = baseMapTexId;
//	glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
//	return true;
//}
//void processMouseButtons(int button, int state, int xx, int yy) 
//{
//
//}
//void processKeys(unsigned char key, int xx, int yy) 
//{
//
//}
//void processMouseMotion(int xx, int yy)
//{
//}
//void mouseWheel(int wheel, int direction, int x, int y)
//{
//}
//void changeSize(int w, int h) {}
//void renderScene(void) 
//{
//	if (quad == NULL)
//	{
//		return;
//	}
//	// Set the viewportw
//	glViewport ( 0, 0, 320,320 );
//	// Clear the color buffer
//	glClear ( GL_COLOR_BUFFER_BIT );
//	// Use the program object
//	glUseProgram ( programObject );
//
//	long offset = (long)quad;
//	// vertex
//	int diff = offsetof( V3F_C4B_T2F, vertices);
//	glVertexAttribPointer(positionLoc, 3, GL_FLOAT, GL_FALSE, sizeof(quad->bl), (void*) (offset + diff));
//
//	// texCoods
//	diff = offsetof( V3F_C4B_T2F, texCoords);
//	glVertexAttribPointer(texCoordLoc, 2, GL_FLOAT, GL_FALSE, sizeof(quad->bl), (void*)(offset + diff));
//
//	// color
//	diff = offsetof( V3F_C4B_T2F, colors);
//	glVertexAttribPointer(colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(quad->bl), (void*)(offset + diff));
//
//	glEnableVertexAttribArray ( positionLoc );
//	glEnableVertexAttribArray ( texCoordLoc );
//	glEnableVertexAttribArray ( colorLoc );
//
//	glActiveTexture ( GL_TEXTURE0 );
//	glBindTexture ( GL_TEXTURE_2D, quad->tex );
//	// Set the base map sampler to texture unit to 0
//	glUniform1i ( baseMapLoc, 0 );
//
//	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
//
//	glutSwapBuffers();
//}
//void shutDown ()
//{
//	// Delete texture object
//	glDeleteTextures ( 1, &baseMapTexId );
//	// Delete program object
//	glDeleteProgram ( programObject );
//}
//int _tmain(int argc, char **argv)
//{
//	//test();
//	//  GLUT initialization
//	glutInit(&argc, argv);
//
//	glutInitDisplayMode(GLUT_DEPTH|GLUT_DOUBLE|GLUT_RGBA|GLUT_MULTISAMPLE);
//
//	glutInitContextVersion (2, 0);
//	glutInitContextFlags (GLUT_COMPATIBILITY_PROFILE );
//
//	glutInitWindowPosition(100,100);
//	glutInitWindowSize(320,320);
//	glutCreateWindow("Hello Textrue!");
//
//
//	//  Callback Registration
//	glutDisplayFunc(renderScene);
//	glutReshapeFunc(changeSize);
//	glutIdleFunc(renderScene);
//
//	//	Mouse and Keyboard Callbacks
//	glutKeyboardFunc(processKeys);
//	glutMouseFunc(processMouseButtons);
//	glutMotionFunc(processMouseMotion);
//
//	glutMouseWheelFunc ( mouseWheel ) ;
//
//	//	Init GLEW
//	//glewExperimental = GL_TRUE;
//	glewInit();
//	if (glewIsSupported("GL_VERSION_2_0"))
//		printf("Ready for OpenGL 2.0\n");
//	else {
//		printf("OpenGL 2.0 not supported\n");
//		exit(1);
//	}
//
//	//  Init the app (load model and textures) and OpenGL
//	if (!init())
//		printf("Could not Load the Model\n");
//
//	printf ("Vendor: %s\n", glGetString (GL_VENDOR));
//	printf ("Renderer: %s\n", glGetString (GL_RENDERER));
//	printf ("Version: %s\n", glGetString (GL_VERSION));
//	printf ("GLSL: %s\n", glGetString (GL_SHADING_LANGUAGE_VERSION));
//
//
//	// return from main loop
//	glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
//
//	//  GLUT main loop
//	glutMainLoop();
//	shutDown();
//}
//
